import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'login',
      component: () => import('../views/login.vue'),
    },
    {
      path: '/index',
      name: 'index',
      redirect: '/main',
      component: () => import('../views/index.vue'),
      children: [
        {
          path: '',
          components: {
            left: () => import('../components/Layout/left.vue'),
            header: () => import('../components/Layout/header.vue'),
            content: () => import('../components/Layout/content.vue'),
          },
        },
      ],
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('../views/HomeView.vue'),
    },
    {
      path: '/about',
      name: 'about',
      component: () => import('../views/AboutView.vue'),
    },
  ],
})

export default router
